# file(GLOB_RECURSE PROTO_FILE_LIST_TMP ${CMAKE_CURRENT_LIST_DIR}/onnx-operators.proto ${CMAKE_CURRENT_LIST_DIR}/onnx.proto)
file(GLOB_RECURSE PROTO_FILE_LIST_TMP ${CMAKE_CURRENT_LIST_DIR}/onnx-operators-ml.proto ${CMAKE_CURRENT_LIST_DIR}/onnx-ml.proto ${CMAKE_CURRENT_LIST_DIR}/onnx-data.proto)
foreach(FILE_TMP ${PROTO_FILE_LIST_TMP})
    file(RELATIVE_PATH FILE_RES ${PROJECT_SOURCE_DIR} ${FILE_TMP})
    execute_process(COMMAND protoc --proto_path=./ --cpp_out=./ ${FILE_RES}
        WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endforeach()

file(GLOB_RECURSE CURRENT_SOURCE_PATH ${CMAKE_CURRENT_LIST_DIR}/*.cc)
file(GLOB_RECURSE CURRENT_HEAD_PATH ${CMAKE_CURRENT_LIST_DIR}/*.h)

set(LIB_NAME mi_onnx)
add_library(${LIB_NAME} OBJECT ${CURRENT_SOURCE_PATH})
target_include_directories(${LIB_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/)
list(APPEND MONOLITH_INFERENCE_OBJECTS $<TARGET_OBJECTS:${LIB_NAME}>)
list(APPEND MONOLITH_INFERENCE_TARGETS ${LIB_NAME})
# list(APPEND MONOLITH_BACKENDS_HEADS ${CMAKE_CURRENT_LIST_DIR}/tensor.h
#     ${CMAKE_CURRENT_LIST_DIR}/macros.h)
